//
//  HDBeaconManager.h
//  HDSmartPenSDKDemo
//
//  Created by 牛的mini on 2016/12/26.
//  Copyright © 2016年 牛的mini. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PeripheralModel.h"
#import "Common1.h"
#import "BLEManager.h"

#define kBeacon_State_Unopen_Notification             @"kBeacon_State_Unopen_Notification"             // 蓝牙未打开
#define kBeacon_Connect_Successful_Notification       @"kBeacon_Connect_Successful_Notification"       // 连接成功
#define kBeacon_Pair_Successful_Notification          @"kBeacon_Pair_Successful_Notification"          // 配对成功
#define kBeacon_Disconnect_Successful_Notification    @"kBeacon_Disconnect_Successful_Notification"    // 连接断开
#define kBeacon_Language_Parameter_Error_Notification @"kBeacon_Language_Parameter_Error_Notification" // 语种传入参数错误
#define kBeacon_LED_Parameter_Error_Notification      @"kBeacon_LED_Parameter_Error_Notification"      // LED传入参数错误

#define kScan_Beacon_And_Reload_Notification @"kScan_Beacon_And_Reload_Notification"
#define kBeacon_SMPen_ID_Notification        @"kBeacon_SMPen_ID_Notification"
#define kBeacon_SMPen_Power_Notification     @"kBeacon_SMPen_Power_Notification"
#define kBeacon_SMPen_NFC_Info_Notification  @"kBeacon_SMPen_NFC_Info_Notification"
#define kBeacon_SMPen_All_Info_Notification  @"kBeacon_SMPen_All_Info_Notification"
#define kBeacon_SMPen_Part_Info_Notification @"kBeacon_SMPen_Part_Info_Notification"
#define kBeacon_SMPen_Disconnect_Notification @"kBeacon_SMPen_Disconnect_Notification"

#define kBeacon_SMPen_Volume_Successful_Notification     @"kBeacon_SMPen_Volume_Successful_Notification"
#define kBeacon_SMPen_Data_Notification  @"kBeacon_SMPen_Data_Notification"
//没有数据
#define kBeacon_SMPen_NoData_Notification  @"kBeacon_SMPen_NoData_Notification"
//单例
#undef	AS_SINGLETON
#define AS_SINGLETON( __class ) \
+ (__class *)sharedInstance;

#undef	DEF_SINGLETON

#define DEF_SINGLETON( __class ) \
+ (__class *)sharedInstance \
{ \
static dispatch_once_t once; \
static __class * __singleton__; \
dispatch_once( &once, ^{ __singleton__ = [[__class alloc] init]; } ); \
return __singleton__; \
}

@interface HDBeaconManager : NSObject
@property (nonatomic, assign, readonly) BOOL isConnected;

+ (id)sharedBeacon;
- (void)startBeacon;
- (void)stopScanAction;

- (void)searchSMPen; // 查找智慧笔(智慧笔震动)
- (void)searchSMPenIDAction; // 获取智慧笔ID
- (void)nfcChanged:(BOOL)isON;
- (void)readPowerAction; //读取电量
- (void)syncData; //离线巡更，同步数据
- (void)heartBeatAction;
- (void)readAllInfoAction; // 读取全部的信息
- (void)volumeIndexChange:(NSInteger)volumeIndex;

- (void)writeLanguageAction:(NSInteger)selectIndex;
- (void)playMp3Action:(NSString *)playNo;

- (void)connectPeripheral:(PeripheralModel *)peripheral;
- (void)disconnectPeripheral:(PeripheralModel *)peripheral;
- (NSString *)SMPenID;

@end
